//
//  BaseViewController.m
//  Day_21 夜间模式
//
//  Created by dllo on 15/11/6.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor orangeColor];
    
    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"whiteOrBlack"] isEqualToString:@"1"]) {
        UIColor *color = [UIColor blackColor];
        self.view.backgroundColor = color;
    }else{
        UIColor *color = [UIColor whiteColor];
        self.view.backgroundColor = color;
        
    }

    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor:) name:@"changeColor" object:nil];
    
}

- (void)changeColor:(NSNotification *)notification{
    UIColor *color = [notification object];
    self.view.backgroundColor = color;
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
